#ifndef _PARTHUS_TRA_USB_H_
#define _PARTHUS_TRA_USB_H_
/*****************************************************************************
 * MODULE NAME:
 * PROJECT CODE:   Bluetooth
 * DESCRIPTION:
 * MAINTAINER:
 * CREATION DATE:
 *
 * SOURCE CONTROL: $Id: tra_usb.h,v 1.4 2008/11/08 07:30:05 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2004 Ceva Inc.
 *     All rights reserved.
 *
 * SOURCE:
 *
 *****************************************************************************/


#include "sys_types.h"
#include "sys_config.h"
#include "hcit_usb.h"


/*
 * Structure for USB
 */

struct tra_hcit_usb_info
{
    /*
     * Common structure (generic HCI transport structure above)
     * Any accesses to members of the common structure below should
     * collapse into additions from the base of the tra_hcit_uart_info
     * structure. NOTE: The common structure _must_ be the first member of
     * this or any other transport type.
     */

    struct tra_hcit_info common;

    /* Functions to initialise, shutdown, transmit a block and transmit a block polled  */

    void (*initialise)(void);
    void (*shutdown)(void);
    int (*transmit)(u_int8 *block_start,u_int32 block_length, u_int8 *header, unsigned int queue,t_deviceIndex device_index);

    void (*poll_tx)(volatile u_int8 **data, volatile u_int32 *len, u_int8 flag);

    /*     bmRequestType : indentifies the characteristics of specific request
     *
     */
    u_int8 request_type;
    /* Error counters and other information
     TBD : cmcs */

};


/*
 * The state variable for the transmit state machine and the
 * associated transmit states used whilst encoding a transmit PDU to the host
 */
enum
{
    TRA_HCIT_USB_STATE_TX_HEADER,
    TRA_HCIT_USB_STATE_TX_BODY
};

/*
 * The state variable for the receive state machine and the
 * associated states used whilst decoding a received PDU from the host
 */
enum
{
    TRA_HCIT_USB_RX_Command,
    TRA_HCIT_USB_STATE_RX_TYPE,
    TRA_HCIT_USB_STATE_RX_HEADER,
    TRA_HCIT_USB_STATE_RX_DATA

};

void TRAhcit_USB_Initialise(void);
void TRAhcit_USB_Shutdown(void);
void TRAhcit_USB_Transmit (u_int8 *data, u_int32 pdu_len, u_int8 *header,
                           u_int8 head_len, u_int8 tra_source,
                           t_deviceIndex device_index);
int TRAhcit_USB_Rx_Data(PM_EPBOUT_STATUS);
int TRAhcit_USB_Rx_Command(void);

void TRAhcit_USB_Acknowledge_Complete_Tx(void);

#endif /* _PARTHUS_TRA_USB_H_ */

